<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!-- DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<%=basePath%>" />
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<link href="css/color.css" rel="stylesheet" type="text/css" />
<title>Project </title>
</head>
<body>
	<h2>Hello,${empty sessionScope.user ? 'Anonymous' : sessionScope.user.nickName}</h2>
	<c:if test="${empty sessionScope.user}">
		<p><a href="login.jsp">Sign In</a></p>
	</c:if>
	<dl class="list">
		<dt>Here are topics in this discuss</dt>
		<c:forEach var="t" items="${topics.topicList}" varStatus="status">
			<dd <c:if test="${status.index % 2 != 0}">class="odd"</c:if>>
				<a href="topic?id=${t.id}">${t.name}</a>
			</dd>
		</c:forEach>
	</dl>
	<form action="newtopic" name="newTopicForm">
	<dl class="list">
		<dt>Create a new Topic:</dt>
		<dd><input type="hidden" name="projectId" value="${topics.projectId}" />
			Topic name:<input type="text" name="name"/>
			<input type="submit" value="Create"/>
		</dd>
	</dl>
	</form>
	
</body>
</html>